<?php

/**
 * main actions.
 *
 * @package    halalmenu_dev
 * @subpackage main
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class mainActions extends sfActions
{ 

    public function executeIndex(sfWebRequest $request)
    {
        $this->limit = 20;
        $this->line = 0; 
        $this->cuisine_list    = Doctrine_Core::getTable('HalalmenuCuisine')->getCuisinesList();
        $this->restaurant_list = Doctrine_Core::getTable('HalalmenuRestaurant')->getRestaurantList();
        $this->ambiance_list   = Doctrine_Core::getTable('HalalmenuAtmosphere')->getAmbianceList();
        $this->service_list    = Doctrine_Core::getTable('HalalmenuService')->getServiceList();
        $this->priceArray      = $this->getPriceList();
        $this->listComments    = Doctrine_Core::getTable('HalalmenuRestaurantCommentsByUser')->retrieveReviewListRestaurant();
        $this->topListRestaurants   = Doctrine_Core::getTable('HalalmenuRestaurantCommentsByUser')->retrieveTopRestaurant();
        $this->Departement = array(
                                   '75' => array('id' => 75, 'departement' => 'paris'),
                                   '77' => array('id' => 77, 'departement' => 'seine-et-marne'),
                                   '78' => array('id' => 78, 'departement' => 'yvelines'),
                                   '91' => array('id' => 91, 'departement' => 'essonne'),
                                   '92' => array('id' => 92, 'departement' => 'haut-de-seine'),
                                   '93' => array('id' => 93, 'departement' => 'saint-denis'),
                                   '94' => array('id' => 94, 'departement' => 'val-de-marne'),
                                   '95' => array('id' => 95, 'departement' => 'val-d-oise')
                                   );
        

        //$class = sfConfig::get('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin'); 
        //$this->form = new $class();
    }
      
    public function getPriceList()
    {
        return array('Moins de 11',
                     'Entre 11 et 20',
                     'Entre 20 et 30',
                     'Plus de 30');
    }
    
    public function executePresentation(sfWebRequest $request)
    {
        $this->titlePage = $request->getParameter('action');
    }
    
    public function executeContact(sfWebRequest $request)
    {
        $this->titlePage = $request->getParameter('action');
        
        $this->formContact = new ContactForm(); 
    }
    
    public function executeAnnonceurs(sfWebRequest $request)
    {
        $this->titlePage = $request->getParameter('action');
    }
    
    public function executeRestaurateurs(sfWebRequest $request)
    {
        $this->titlePage = $request->getParameter('action');
    }
    
    public function executeMentionlegales(sfWebRequest $request)
    {
        $this->titlePage = $request->getParameter('action');
    }
    
    public function executePlandusite(sfWebRequest $request)
    {
        $this->titlePage = $request->getParameter('action');
    }
    
    public function executeBlog(sfWebRequest $request)
    {
        
    }
}
